<?php
require_once 'config.php';


$page = PGlobal::getAdminLayoutTemplate();
$page['content'] = new Template(TEMPLATE_DIR . 'admin-hangsx.html');
$db = new Database();
$data = $db->run('SELECT * FROM hangsx');
$stt = 0;
foreach ($data as $row) {
    $item = new Template(TEMPLATE_DIR . 'admin-hangsx-item.html');
    $item->setArray($row);
    $item['stt'] = ++$stt;

    $page['content']['admin-hangsx-item'] .= $item->render();
}

$page['stt_max'] = ++$stt;


$page['extra'] = new Template(TEMPLATE_DIR . 'admin-hangsx-dialog.html');

$page->addCss('css/admin-hangsx.css');
$page->addJs('jsc/jquery.metadata.js');
$page->addJs('jsc/admin-hangsx.js');
echo$page->render();